﻿@using NewRen.Models;
@using NewRen.Models.ViewModel;
@{
    ViewBag.Title = "检索";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="banner">
    <div class="container">
        <div class="logo">
            <img src="~/Images/logo.jpg" width="120" height="60">
        </div>
        <div class="search-block">
            <form class="search" action="/Search/Index">
                <input type="text" placeholder="请输入要检索的牛人、牛棚" name="key" class="search-query" />
                <input type="submit" value="搜索" class="search-submit" />
            </form>
        </div>
        <div class="clr"></div>
    </div>
</div>
<div class="container top20" style="display: table;">
    <input type="hidden" name="key" value="@ViewBag.Key" id="key" />
    <div class="col-8">
        <input type="hidden" id="sortby" value="@Request.QueryString["sort"]" />
        <div class="search-banner clearfix">
            <ul class="seq-sort">
                <li><a href="/Search/Index?key=@Request.QueryString["key"]&sort=default" class="@(Request.QueryString["sort"]==null?"active":"")">默认排序</a></li>
                <li><a href="/Search/Index?key=@Request.QueryString["key"]&sort=time" class="@(Request.QueryString["sort"]=="time"?"active":"")">按照时间</a></li>
                <li><a href="/Search/Index?key=@Request.QueryString["key"]&sort=hot" class="@(Request.QueryString["sort"]=="hot"?"active":"")">按照热度</a> </li>
            </ul>
        </div>
        <div class="search-tab">
            <a href="javascript:void(0)" class="tab tab_select" onclick="SearchLink('user')">牛人(@ViewBag.UserCount)</a>
            <a href="javascript:void(0)" class="tab" onclick="SearchLink('group')">牛棚(@ViewBag.GroupCount)</a>
        </div>
        <div class="search-result">
            <div class="" id="resultLst">

            </div>
            <div class="more">
            </div>
        </div>
    </div>
    <div class="col-4">
        <div class="search-con">
            <div class="hotssearch">
                <h3>热搜关键词</h3>
            </div>
            <div class="searchActive">
                <span class="search_key">
                    关键词
                </span>
                <span class="search-num">
                    搜索次数
                </span>
            </div>
            @foreach (SearchHot item in ViewBag.HotSearch)
            {
                <div class="searchActive">
                    <span class="search_key">
                        <a href="/Search/Index/?key=@item.Key" class="shareActive_img">
                            @item.Key
                        </a>
                    </span>
                    <span class="search-num">
                        @item.Num
                    </span>
                </div>
            }
        </div>

        <div class="search-con" style="height:600px;overflow:hidden">
            <div class="hotssearch">
                <h3>精选</h3>
            </div>
            <div class="searchActive scrollup">
                <ul>
                    @foreach (var item in ViewBag.Users as List<User>)
                    {
                        <li>
                            <div class="scroll-img">
                                <a href="/User/PersonalShow/@item.ID">
                                    @if (item.Picture == null)
                                    {
                                        <img src="/Images/userphoto.png" width="136" height="100"
                                             alt=@item.UserName />
                                    }
                                    else
                                    {
                                        <img src="/User/ShowPicture/@item.ID" width="136"
                                             alt=@item.UserName height="100" />
                                    }
                                </a>
                            </div>
                           <div class="scroll-txt">
                               <span><a href="/User/PersonalShow/@item.ID">@item.UserName</a></span>
                           </div>
                        </li>
                    }
                </ul>
            </div>
        </div>
        <script>
            $(".scrollup").imgscroll({
                speed: 80,    //图片滚动速度
                amount: 0,    //图片滚动过渡时间
                width: 1,     //图片滚动步数
                dir: "up"   // "left" 或 "up" 向左或向上滚动
            });
        </script>
    </div>
</div>
